FINERACT-2494: Add unit tests for ApiParameterHelper in fineract-core.#5677
FINERACT-2494: Add unit tests for ApiParameterHelper in fineract-core.#5677San-43 wants to merge 1 commit intoapache:developfrom
Conversation
|
Hi @San-43 , I see you're working on this issue! I’ve already submitted PR #5665 addressing FINERACT-2494. My approach focuses on building a comprehensive unit test suite for ApiParameterHelper, including coverage for edge cases such as null handling, negative offsets, malformed inputs, and boundary conditions. The tests are designed as isolated JUnit 5 unit tests to ensure reliability and maintainability within fineract-core, and I’m also aligning with static analysis improvements from FINERACT-2510. Happy to align approaches or incorporate any feedback from the community. |
|
Hi @Ambika-Sony, thanks for the note and for your work on this. I actually hadn’t noticed #5665 when I started #5677. I saw a couple of closed PR targeting FINERACT-2494, but I missed #5665, apologies for that. After comparing #5665 and #5677, my view is that #5677 is a bit cleaner for FINERACT-2494 because it keeps the change strictly tests-only, in line with the ticket scope. In #5665, there are also I’m happy to align and avoid duplication. If maintainers prefer a single path, I can either:
Happy to follow maintainer guidance either way. |
Hi @San-43, Regarding the scope: the 'production-code changes' in #5665 weren't just extra additions; they are hardening fixes specifically required to address NullPointerExceptions and boundary errors that my 22+ test cases exposed. A tests-only PR (#5677) would pass on the current code but would leave these underlying stability issues unaddressed. I believe it's critical for the project to not only have tests but to resolve the vulnerabilities those tests reveal. I'm happy to let the maintainers decide the best path forward, but I will be keeping #5665 active as a comprehensive solution for FINERACT-2494 that ensures both coverage and core stability. |
91aa040 to
a8a81b2
Compare
Description
This PR fixes FINERACT-2494.
New test coverage for API parameter extraction and parsing:
ApiParameterHelperTestwith tests for extracting and validatingcommandId, fields, associations, and locale from query parameters, including handling of missing, blank, invalid, and duplicate values.parameterType,template,makerCheckerable,includeJson, andgenericResultSet, verifying correct handling of true, false, and missing values.genericResultSetflag.Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.